<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" template="/mainTemplate.xhtml">

    <ui:define name="content">
        <h:form id="equipmentPage">
        <p:growl id="messages" showDetail="true" sticky="true" />
        <p:toolbar id="toolbar" style="margin-top:20px; margin-bottom:5px">
            <p:toolbarGroup align="left">
                <p:commandButton value="Добавить"
                                 action="#{equipmentsBean.addEquipment()}" style="font-size: 85% !important"/>
                <p:commandButton value="Редактировать"
                                 action="#{equipmentsBean.editEquipment()}" style="font-size: 85% !important"/>
                <p:commandButton value="Просмотреть"
                                 action="#{equipmentsBean.viewEquipment()}" style="font-size: 85% !important"/>
            </p:toolbarGroup>
        </p:toolbar>
            <p:dataTable id="equipmentsTable" var="equipment"
                         value="#{equipmentsBean.equipmentList}"
                         selection="#{equipmentsBean.equipment}" selectionMode="single">

                <p:column id="equipment_name" headerText="Наименование">
                    <h:outputText value="#{equipment.name}" />
                </p:column>
                <p:column id="equipment_full_name" headerText="Полное название">
                    <h:outputText value="#{equipment.fullName}" />
                </p:column>
                <p:column id="equipment_desc" headerText="Описание">
                    <h:outputText value="#{equipment.description}}" />
                </p:column>
                <p:column id="equipment_type" headerText="Тип">
                    <h:outputText value="#{equipment.equipmentsTypes.name}" />
                </p:column>
                <p:column id="equipment_units" headerText="Единицы измерения">
                    <h:outputText value="#{equipment.units.name}" />
                </p:column>
            </p:dataTable>

        </h:form>
        <h:form id="equipmentCreateDialogForm">

        </h:form>

    </ui:define>

</ui:composition>